import 'package:flutter/material.dart';
import 'package:flutter_again/parsers/implementations/ptt_parser.dart';
import 'package:provider/provider.dart';
import './router/index.dart';
import 'package:flutter_again/services/video_platform_manager.dart';
import 'package:flutter_again/utils/setup.dart';

void main() {
  setup();
  runApp(const AppWidget());
}

class AppWidget extends StatelessWidget {
  const AppWidget({ super.key });
  @override
  Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider<VideoPlatformManager>(create: (_) => VideoPlatformManager()..registerParser(PttParser()),),
      ],
      child: MaterialApp.router(
        routerConfig: router,
      ),
    );
  }
}
